import React from 'react'
import { useNavigate, Outlet } from 'react-router-dom'

export default function News() {
  const navigate = useNavigate()
  return (
    <div style={{background:"greenyellow"}}>
      <h2>News</h2>
      <div>
       <button onClick={()=>{
        navigate('/home/news/item',{
          state:{
            id:1,
            name:'国内'
          }
        })
       }}>
        国内新闻
       </button>
       <button onClick={()=>{
        navigate('/home/news/item',{
          state:{
            id:2,
            name:'国外'
          }
        })
       }}>
        国外新闻
       </button>
       <button onClick={()=>{
        navigate('/home/news/item',{
          state:{
            id:3,
            name:'周边'
          }
        })
       }}>
        周边新闻
       </button>
      </div>

      <Outlet />

    </div>
  )
}
